<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>{$lang.home}{if $ur_here} - {$ur_here} {/if}</title>
<meta name="Copyright" content="Douco Design." />
<link href="templates/public.css" rel="stylesheet" type="text/css">
{include file="javascript.htm"}
<script src="images/laydate/laydate.js"></script>
<script>
{literal}
$(function(){
  init_edittime();
});
{/literal}
</script>
</head>
<body>
<div id="dcWrap">
 {include file="header.htm"}
 <div id="dcLeft">{include file="menu.htm"}</div>
 <div id="dcMain">
   {include file="ur_here.htm"}
   <div id="user" class="mainBox" style="{$workspace.height}">
    <h3><a href="{$useradd_link.href}" class="actionBtn add">{$useradd_link.text}</a> <a href="{$userlist_link.href}" class="actionBtn">{$userlist_link.text}</a>  {$ur_here}</h3>

    <!-- {if $rec eq 'default'} 会员列表 -->
    <div class="filter">
      <form action="robot.php" method="post">
        <input name="nickname" class="inpMain" placeholder="输入昵称" value="" size="20" type="text">
        <select name="group_id">
          <option value="">用户组</option>
          {foreach from=$lang.group_in item=v key=k}
          <option value="{$k}">{$v}</option>
          {/foreach}
        </select>
        <select name="room_id">
          <option value="">所属房间</option>
          {foreach from=$rooms item=v key=k}
          <option value="{$v.id}">{$v.name}</option>
          {/foreach}
        </select>
        <input name="submit" class="btnGray" value="查询" type="submit">
      </form>
    </div>
    <table width="100%" border="0" cellpadding="8" cellspacing="0" class="tableBasic">
     <tr>
      <th width="30" align="left">{$lang.record_id}</th>
      <th align="center">{$lang.avatar}</th>
      <th align="center">{$lang.user_nickname}</th>
      <th align="center">{$lang.in_room}</th>
      <th align="center">{$lang.group}</th>
      <th align="center">{$lang.up_time}</th>
      <th align="center">{$lang.down_time}</th>
      <th align="center">{$lang.status}</th>
      <th>{$lang.handler}</th>
     </tr>
     <!-- {foreach from=$user_list item=user} -->
     <tr>
      <td>{$user.id}</td>
      <td align="center"><img src='{$site_url}{$user.avatar}' width="30" height="30"></td>
      <td align="center">{$user.nickname}</td>
      <td align="center">{$rooms[$user.room_id].name}</td>
      <td align="center">{$lang.group_in[$user.group_id]}</td>
      <td align="center">{$user.up_time}</td>
      <td align="center">{$user.down_time}</td>
      <td align="center">{$lang.user_status[$user.status]}</td>
      <td align="center" align="center">
        <a href="robot.php?rec=edit&id={$user.id}">{$lang.edit}</a> | 
        <a href="robot.php?rec=del&id={$user.id}">{$lang.del}</a>  
     </tr>
     <!-- {/foreach} -->
    </table>
    {include file="pager.htm"}
    <!-- {/if} -->
    
    <!-- {if $rec eq 'edit' || $rec eq 'add'} 会员编辑 -->
    <form action="robot.php?rec={if $rec eq 'edit'}update{else}insert{/if}" method="post" enctype="multipart/form-data">
     <table width="100%" border="0" cellpadding="8" cellspacing="0" class="tableBasic">
      <tr>
       <td width="100" align="right">{$lang.user_nickname}</td>
       <td><input type="text" name="nickname" value="{$user_info.nickname}" size="40" class="inpMain"/></td>
      </tr>
      <tr>
       <td align="right">{$lang.avatar}</td>
       <td>
        <input type="file" name="avatar" size="38" class="inpFlie" />
        {if $user_info.avatar}<a href="{$user_info.avatar}" target="_blank"><img class="middle" src="{$site_url}{$user_info.avatar}" width="30" height="30"></a>{else}<img src="images/icon_no.png">{/if}
        </td>
      </tr>
      <tr>
       <td width="100" align="right">{$lang.in_room}</td>
       <td>
         <select name="room_id">
          <option value="" >{$lang.in_room}</option>
         {foreach from=$rooms item=v key=k}
         <option value="{$v.id}" {if $user_info.room_id==$v.id}selected=selected{/if}>{$v.name}</option>
         {/foreach}
          </select>
       </td>
      </tr>
      <tr>
       <td width="100" align="right">{$lang.group}</td>
       <td>
         <select name="group_id">
         {foreach from=$lang.group_in item=v key=k}
         <option value="{$k}" {if $k==$user_info.group_id}selected=selected{/if} >{$v}</option>
         {/foreach}
          </select>
       </td>
      </tr>
      <tr>
       <td width="100" align="right">{$lang.up_week}</td>
       <td>
          {foreach from=$lang.week_in item=v key=k}
          <input type="checkbox" name="up_week[]" value="{$k}" {if @in_array($k,$user_info.up_week)}checked=checked{/if}  /> {$v}&nbsp;
          {/foreach}
       </td>
      </tr>
      <tr>
       <td width="100" align="right">{$lang.up_time}</td>
       <td><input type="text" name="up_time" value="{$user_info.up_time}" size="40" class="inpMain time-item"/></td>
      </tr>
      <tr>
       <td width="100" align="right">{$lang.down_time}</td>
       <td><input type="text" name="down_time" value="{$user_info.down_time}" size="40" class="inpMain time-item"/></td>
      </tr>
      <tr>
       <td width="100" align="right">{$lang.status}</td>
       <td>
          {foreach from=$lang.user_status item=v key=k}
          {$v} <input type="radio" name="status" value="{$k}" {if $k==$user_info.status}checked="checked"{/if} />&nbsp;&nbsp; 
          {/foreach}
       </td>
      </tr>
      <tr>
       <td></td>
       <td>
        <input type="hidden" name="token" value="{$token}" />
        <input type="hidden" name="id" value="{$user_info.id}" />
        <input type="submit" name="submit" class="btn" value="{$lang.btn_submit}" />
       </td>
      </tr>
     </table>
    </form>
    <!-- {/if} -->



   </div>
 </div>
 {include file="footer.htm"}
 </div>
</body>
</html>